import React, { Component } from 'react'
import { mineRouterTwoData } from "../../routes"

import { NavLink } from "react-router-dom"
// view视图
import View from '../../routes/view';

import "./main.less"
export default class Main extends Component {
    render() {
        return (
            <div className='main'>
                <div className='viewBox'>
                    <View routes={mineRouterTwoData()}></View>
                </div>
                {
                    this.props.location.pathname === "/main/WeChat" || this.props.location.pathname === "/main/addressList" || this.props.location.pathname === "/main/discover" || this.props.location.pathname === "/main/mine" ? <div className='footer'>
                        {
                            mineRouterTwoData().map((item, index) => {
                                if (item.title === undefined) return false
                                return <NavLink key={index} to={item.path}>
                                    <svg className="icon" aria-hidden="true">
                                        <use xlinkHref={item.icon}></use>
                                    </svg>
                                    <span>{item.title}</span>
                                </NavLink>
                            })
                        }
                    </div> : null
                }
            </div>
        )
    }
}
